package model

import (
	"fmt"

	"gorm.io/gorm"
)

type GameInfo struct {
	gorm.Model
	Name           string `gorm:"size:255;not null;uniqueIndex" json:"name"`
	Desc           string `gorm:"type:text" json:"desc"`
	ProblemToSolve string `gorm:"type:text;column:problem_to_solve" json:"problem_to_solve"`
}

func (GameInfo) TableName() string {
	return "game_info"
}

func (g GameInfo) Template() string {
	return fmt.Sprintf("Game ID: %d, Description: %s, Problem to Solve: %s", g.ID, g.Desc, g.ProblemToSolve)
}
